package com.pcs.service.impl;

import com.pcs.dao.UserVerificationMapper;
import com.pcs.pojo.UserVerification;
import com.pcs.service.IUserVerificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userVerificationService")
public class UserVerificationServiceImpl implements IUserVerificationService {
	@Resource
	private UserVerificationMapper userVerificationDao;

	@Override
	public int deleteByPrimaryKey(Integer uvId) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.deleteByPrimaryKey(uvId);
	}

	@Override
	public int insert(UserVerification record) {

		// TODO Auto-generated method stub
		return this.userVerificationDao.insert(record);

	}

	@Override
	public int insertSelective(UserVerification record) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.insertSelective(record);

	}

	@Override
	public UserVerification selectByPrimaryKey(Integer uvId) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.selectByPrimaryKey(uvId);

	}

	@Override
	public UserVerification selectByPhone(String phone) {
		return this.userVerificationDao.selectByPhone(phone);
	}

	@Override
	public int updateByPrimaryKeySelective(UserVerification record) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.updateByPrimaryKeySelective(record);

	}

	@Override
	public int updateByPrimaryKey(UserVerification record) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.updateByPrimaryKey(record);

	}

	@Override
	public UserVerification login(UserVerification record) {

		UserVerification user = this.userVerificationDao.login(record);
		System.out.println("servce 层" + user);
		// TODO Auto-generated method stub
		return this.userVerificationDao.login(record);
	}

	@Override
	public List<UserVerification> findAll() {
		// TODO Auto-generated method stub
		return this.userVerificationDao.findAll();
	}

	@Override
	public int updateByuId(UserVerification record) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.updateByuId(record);
	}

	@Override
	public Integer deleteByuId(Integer uId) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.deleteByuId(uId);
	}

	@Override
	public Integer updatePassword(UserVerification userVerification) {
		// TODO Auto-generated method stub
		return this.userVerificationDao.updatePassword(userVerification);
	}

	public static void main(String[] args) {
		UserVerificationServiceImpl userVerificationService = new UserVerificationServiceImpl();
		UserVerification userVerification = new UserVerification();
		userVerification.setLoginToken("yeenjie");
		userVerification.setPasswordToken("9481E0D7A83CB52A");
		System.out.println(userVerificationService.userVerificationDao.login(userVerification));
		System.out.println(userVerification);
	}
}

